// card 模块组件
import { defineComponent } from "vue";
import "./index.scss";
const CardBox = defineComponent({
	props: {
		titleHeight: {
			type: String,
			default: "45px"
		},
		title: {
			type: String,
			default: "标题"
		},
		icon: {
			type: String
		}
	},
	setup(props, { slots }) {
		return () => {
			return (
				<div class="card-box">
					<div class="card-box-title" style={`height: ${props.titleHeight}`}>
						{props.icon ? <img src={props.icon} class={"card-box-title-icon"} /> : null}
						<span class="card-box-title-label">{props.title}</span>
						<div class="card-box-title-content">{slots.title?.()}</div>
					</div>
					<div class="card-box-content">
						<div class="card-box-scroll">{slots.default?.()}</div>
					</div>
				</div>
			);
		};
	}
});
export default CardBox;
